<html>
<head><meta charset="utf-8"><title>why &quot;--test-args --nocapture&quot; not work on some test case? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20.22--test-args.20--nocapture.22.20not.20work.20on.20some.20test.20case.3F.html">why &quot;--test-args --nocapture&quot; not work on some test case?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="184000483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20%22--test-args%20--nocapture%22%20not%20work%20on%20some%20test%20case%3F/near/184000483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Derek <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20.22--test-args.20--nocapture.22.20not.20work.20on.20some.20test.20case.3F.html#184000483">(Dec 21 2019 at 07:46)</a>:</h4>
<p>I tried to run some testcases, from rustc-guide book,  I use following command:<br>
./x.py test -i --stage 1 src/libsyntax --keep-stage 1 --test-args --nocapture<br>
it works, and I can get output from console for all println!(). <br>
however, this command is not work:<br>
./x.py test -i --stage 1 src/test/ui-fulldeps/pprust-expr-roundtrip.rs --keep-stage 1 --test-args --nocapture <br>
thread 'main' panicked at 'UnrecognizedOption("nocapture")', <br>
the difference is, <a href="http://pprust-expr-roundtrip.rs" target="_blank" title="http://pprust-expr-roundtrip.rs">pprust-expr-roundtrip.rs</a> has a main method, this main method doesn't handle --nocapture. <br>
my question is, in this case how can I get console output for all println!(). Thanks. I can't  find answer from rustc-guide book. Thanks.</p>



<a name="184003867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20%22--test-args%20--nocapture%22%20not%20work%20on%20some%20test%20case%3F/near/184003867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20.22--test-args.20--nocapture.22.20not.20work.20on.20some.20test.20case.3F.html#184003867">(Dec 21 2019 at 09:41)</a>:</h4>
<p>I usually just put a <code>panic!()</code> at the end of the ui test so it breaks and shows me all the other output, but that's obviously not great</p>



<a name="184020070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/why%20%22--test-args%20--nocapture%22%20not%20work%20on%20some%20test%20case%3F/near/184020070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Derek <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/why.20.22--test-args.20--nocapture.22.20not.20work.20on.20some.20test.20case.3F.html#184020070">(Dec 21 2019 at 18:14)</a>:</h4>
<p>Thanks, At least it works!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>